//
//  NSMutableArray+Lc.h
//  18Birdies
//
//  Created by Lc on 16/5/20.
//  Copyright © 2016年 Lc. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSMutableArray (Lc)

+ (NSMutableArray*)arrayWithObjectsInArray:(NSArray*)array withRange:(NSRange)range;

/**
 One dimensional array

 @param length       length description
 @param defaultValue defaultValue description

 @return return value description
 */
+ (NSMutableArray*)arrayWithLength:(int)length defaultValue:(NSObject*)defaultValue;

+ (NSMutableArray*)fixArray:(NSMutableArray*)array
                     length:(int)length
               defaultValue:(NSObject*)defaultValue;

+ (NSMutableArray*)clearAndFixArray:(NSMutableArray*)array
                             length:(int)length
                       defaultValue:(NSObject*)defaultValue;

/**
 Two dimensional array

 @param dimension1Length dimension1Length description
 @param dimension2Length dimension2Length description
 @param defaultValue     defaultValue description

 @return return value description
 */
+ (NSMutableArray*)arrayWithDimension1Length:(int)dimension1Length
                            dimension2Length:(int)dimension2Length
                                defaultValue:(NSObject*)defaultValue;

+ (NSMutableArray*)fixArray:(NSMutableArray*)array
           dimension1Length:(int)dimension1Length
           dimension2Length:(int)dimension2Length
               defaultValue:(NSObject*)defaultValue;

+ (NSMutableArray*)clearAndfixArray:(NSMutableArray*)array
                   dimension1Length:(int)dimension1Length
                   dimension2Length:(int)dimension2Length
                       defaultValue:(NSObject*)defaultValue;

#pragma mark -

- (void)removeObjectIfNeed:(id)anObject;
- (void)addObjectIfNeed:(id)anObject;

@end
